#include "Point.h"
#include "_Math.h"

// -----------------------------------------------------------
void Point2D::RotateTransform(int rot)
{
	int CosA = CMath::Cos(rot);
	int SinA = CMath::Sin(rot);

	int x1 = ((x * CosA - y * SinA) + (1 << (COS_SIN_SHIFT - 1))) >> COS_SIN_SHIFT;
	int y1 = ((y * CosA + x * SinA) + (1 << (COS_SIN_SHIFT - 1))) >> COS_SIN_SHIFT;

	x = x1;
	y = y1;
}

// -----------------------------------------------------------
void Point2D::TranslateTransform(int tx, int ty)
{
	x += tx;
	y += ty;
}